@extends('admin.common.web')

@section('title','订单详情')

@section('style')
    <style type="text/css">
        .text_line {
            margin-bottom: 12px;
        }
    </style>
@endsection

@section('content')
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <a href="{{ route('admin.index.index') }}">系统</a>
            </li>
            <li class="active">
                <a href="{{ route('admin.order.index') }}">订单管理</a>
            </li>
            <li class="active">订单详情</li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->

    <!-- Page Body -->
    <div class="page-body">
        @include('admin.common.msg')


        <div class="row">
            <div class="col-lg-12 col-sm-12 col-xs-12">
                <div class="widget radius-bordered">
                    <div class="widget-header">
                        <span class="widget-caption">
                            <button type="button" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{{ route('admin.order.index') }}'">
            返回列表
        </button>
                        </span>
                        <div class="widget-buttons">
                            <a href="#" data-toggle="collapse">
                                <i class="fa fa-minus danger"></i>
                            </a>
                        </div><!--Widget Buttons-->
                    </div><!--Widget Header-->
                    <div class="widget-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">订单sn：{{ $order['order_sn'] }}</span>
                                </div>
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">所属用户：{{ $order['user']['nick_name'] }}({{ $order['user']['username'] }})</span>
                                </div>
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">订单状态：{{ $order_status[$order['status']] }}</span>
                                </div>
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">商品总数：{{ $order['goods_total'] }} 件</span>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-12">
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">总价格：{{ $order['price_total'] }}</span>
                                </div>
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">下单时间：{{ $order['created_at'] }}</span>
                                </div>
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">支付时间：{{ $order['pay_time'] }}</span>
                                </div>
                                <div class="col-sm-3 text_line">
                                    @if($order['pay_type'] == 1)
                                        <span class="col-sm-12">支付类型：支付宝支付
                                    @elseif($order['pay_type'] == 2)
                                        <span class="col-sm-12">支付类型：微信支付
                                    @elseif($order['pay_type'] == 3)
                                        <span class="col-sm-12">支付类型：余额支付
                                    @endif
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-12">
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">收货人：{{ $order['username'] }}</span>
                                </div>
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">收货人电话：{{ $order['tel'] }}</span>
                                </div>
                                <div class="col-sm-3 text_line">
                                    <span class="col-sm-12">快递单号：{{ $order['express_no'] }}</span>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-12">
                                <div class="col-sm-6 text_line">
                                    <span class="col-sm-12">订单备注：{{ $order['remark'] }}</span>
                                </div>
                                <div class="col-sm-6 text_line">
                                    <span class="col-sm-12">收货地址：{{ str_replace('中国,','',$order["area"]) . $order['address'] }}</span>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-sm-12">
                                <div class="col-sm-12">
                                    <table class="table table-hover">
                                        <thead class="bordered-darkorange">
                                        <tr>
                                            <th>商品id</th>
                                            <th>图片</th>
                                            <th>商品名称</th>
                                            <th>商品配置</th>
                                            <th>数量</th>
                                            <th>单价</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($order_info as $v)
                                            <tr>
                                                <td>{{ $v['goods_id'] }}</td>
                                                <td>
                                                    <img src="{{ asset($v['thumb']) }}" width="30" height="30" alt=""/>
                                                </td>
                                                <td>{{ $v['goods_name'] }}</td>
                                                <td>
                                                    @foreach($v['spec'] as $spec)
                                                        <span>{{ $spec['spec_name'] }}：{{ $spec['value'] }}</span>
                                                        <br>
                                                    @endforeach
                                                </td>
                                                <td>{{ $v['number'] }}</td>
                                                <td>{{ $v['price'] }}</td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div style="clear: both"></div>
                    </div><!--Widget Body-->
                </div><!--Widget-->
            </div>
        </div>

    </div>
@endsection
